<?php include  APP_PATH.'../template/public/header.php'?>
<aside class="main-sidebar">
    <section class="sidebar">
        <?php include APP_PATH.'../template/public/navigation.php'?>
    </section>
</aside>
<div class="content-wrapper">
    <section class="content-header">
        <h1>
            {$title}

        </h1>

        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> {$title}</a></li>
        </ol>
    </section>
    <section class="content">

        <div class="box">
            <div class="box-body">
                <div class="col-md-6">
                    <div class="box-header with-border">
                        <h3 class="box-title">代理商</h3>
                    </div>
                    <form role="form" action="{:url('')}" method="post">
                        <input type="text" class="layui-hide" id="role"  name="role" value="1">
                        <div class="box-body">
                            <div class="form-group">
                                <label for="username">用户名</label>
                                <input type="text" class="form-control" id="username" name="username" placeholder="登录用户名">
                                <span id="info" style="color: green"></span>
                            </div>
                            <div class="form-group">
                                <label for="password">密码</label>
                                <input type="text" class="form-control" id="password" name="password" placeholder="Password">
                            </div>
                        </div>
                        <div class="box-footer">
                            <button type="submit" class="btn btn-primary">添加</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </section>
</div>
<?php include APP_PATH.'../template/public/footer.php'; ?>
<script>
$(function () {
    {if isset($msg)}
    layer.msg('{$msg}', {time: 1800, icon: 1})
    location.href='{:url("agent_list")}';
    {else/}
        return false;
    {/if}
});
$("#username").blur(function(){
    var username=$("#username").val();
    $.get('{:url("get_username")}?username='+username,function (res) {
            if(res.code>0){
                $('#info').attr('style','color:green');
                $('#info').html(res.msg);
            }else{
                $('#info').attr('style','color:red');
                $('#info').html(res.msg);
            }
    });
});
</script>
</html>